package com.clementheliou.cheliou.dal.model.photo.enumeration;

import com.clementheliou.cheliou.dal.model.photo.Photo;

/**
 * Enumeration that contains the sortable columns of the {@link Photo} entities.
 * 
 * @author Clément HELIOU (clement.heliou@gmail.com)
 * @since 1.0
 */
public enum PhotoSortableColumn {

	/**
	 * The photo's addition date.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @since 1.0
	 */
	ADDITION_DATE("additionDate", "enum_photo_sortable_column_addition_date"),

	/**
	 * The photo's shooting date.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @since 1.0
	 */
	SHOOTING_DATE("shootingDate", "enum_photo_sortable_column_shooting_date");

	/**
	 * Name of the column that should be used in the DB side to sort. Be careful not to give the
	 * entity field name.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @since 1.0
	 */
	private String columnName;

	/**
	 * Key of the label to be translated in the views layers. These last ones must provide the
	 * translations.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @since 1.0
	 */
	private String labelKey;

	/**
	 * Builder from the fields.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @param columnName the column name to be used.
	 * @param labelKey the label key to be used.
	 * @since 1.0
	 */
	private PhotoSortableColumn(String columnName, String labelKey) {
		this.columnName = columnName;
		this.labelKey = labelKey;
	}

	/*
	 * Getters & setters.
	 */

	public String getColumnName() {
		return columnName;
	}

	public String getLabelKey() {
		return labelKey;
	}

}
